package cn.com.cnxfs.relaxchat.service.impl;

import cn.com.cnxfs.relaxchat.dao.LoginDao;
import cn.com.cnxfs.relaxchat.entity.Login;
import cn.com.cnxfs.relaxchat.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginService implements ILoginService {
    @Autowired
    private LoginDao loginDao;

    @Override
    public Login login(String username, String password) {
        return loginDao.login(username, password);
    }

    @Override
    public Login search(String username) {
        return loginDao.search(username);
    }

    @Override
    public Login getid(int id) {
        return loginDao.getid(id);
    }

    @Override
    public void add(String username, String password, String nickname) {
        loginDao.add(username, password, nickname);
    }

    @Override
    public void update_pass(int id, String password) {
        loginDao.update_pass(id, password);
    }

    @Override
    public void update_name(int id, String nickname) {
        loginDao.update_name(id, nickname);
    }

    @Override
    public void del(int id) {
        loginDao.del(id);
    }
}
